The present disclosure relates to an electronic device to which a detachable member is attached, and to an image forming apparatus.
A detachable member such as a toner container is attached to an electronic device such as a printer. For example, an electronic device of this type detects attachment state of the detachable member by using a switch that alternates between a conductive state and a non-conductive state depending on whether or not the detachable member is attached to a device main body. In addition, there is known a related technology for removing an oxide film that has been formed on a contact of the switch, by flowing a larger current than normal through the switch when the switch is in the conductive state.